package org.feign.client;

import org.feign.autoconfiger.FeignConfiguration;
import org.feign.client.fallback.UserFeignClientFallback;
import org.feign.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

//代表当前是一个feign客户端 参数代表要调用微服务名称
@FeignClient(value = "user-service",fallback = UserFeignClientFallback.class,
        configuration = FeignConfiguration.class)
public interface UserFeignClient {

    @RequestMapping("/user/{id}")
    public User findById(@PathVariable("id") String id);

}
